package com.bieyang.anjia.viewmodel;

import com.bieyang.anjia.net.NetProccess;
import com.bieyang.anjia.refresh.BasicHandler;
import com.bieyang.anjia.refresh.Refresher;
import com.bieyang.anjia.refresh.Response;

/*************************文件信息*****************************
 * 模块名：AnJia
 * 文件名：BaseViewModel.java
 * 创建者：刘松
 * 创建日期：2014-12-30
 * 功能描述：
 ***********************************************************/
public abstract class BaseViewModel {

	protected Refresher<?> refresher;
	
	protected NetProccess netProccess;

	public BaseViewModel(Refresher<? extends BaseViewModel> refresher) {
		this.refresher = refresher;
		this.netProccess = NetProccess.getDefault(BasicHandler.application);
		BasicHandler.registerHandler(this);
	}
	
	public void release(){
		BasicHandler.unRegisterHandler(this);
	}

	public abstract void handle(Response resp);
}
